package com.vcs.domain;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.CascadeType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.Id;

import org.hibernate.annotations.Type;

@Entity
@Table(name = "jobs")
@SuppressWarnings("serial")
public class Job implements java.io.Serializable, Comparable<Job> {

	private Long jobId;
	private Long clientId;
	private String jobTitle;
	private String jobDescription;
	private String keySkills;
	private int minExp;
	private int maxExp;
	private int jobLocation;
	private int functionalArea;
	private String jobRole;

	// compensation fixed/industry standards/negotiable
	private int compensationType;
	private int minCompensation;
	private int maxCompensation;

	private int qualification;
	private int industry;
	private String companyProfile;
	// permanent, temporary/contractual, freelancer
	private int employmentType;
	// fulltime, parttime
	private int employmentStatus;

	// contact information
	private String companyName;
	private String contactName;
	private Long contactNumber;
	private String emailForResponse;
	// metadata
	private java.util.Date jobPostDate;
	private boolean status;

	/**
	 * Default constructor
	 */
	public Job() {
		// TODO Auto-generated constructor stub
	}

	@Id
	@GeneratedValue
	@Column(name = "job_id")
	public Long getJobId() {
		return jobId;
	}

	public void setJobId(Long jobId) {
		this.jobId = jobId;
	}

	@Column(name = "job_title")
	public String getJobTitle() {
		return jobTitle;
	}

	public void setJobTitle(String jobTitle) {
		this.jobTitle = jobTitle;
	}

	@Column(name = "client_id")
	public Long getClientId() {
		return clientId;
	}

	public void setClientId(Long clientId) {
		this.clientId = clientId;
	}

	@Column(name = "job_description")
	public String getJobDescription() {
		return jobDescription;
	}

	public void setJobDescription(String jobDescription) {
		this.jobDescription = jobDescription;
	}

	@Column(name = "key_skills")
	public String getKeySkills() {
		return keySkills;
	}

	public void setKeySkills(String keySkills) {
		this.keySkills = keySkills;
	}

	@Column(name = "min_exp")
	public int getMinExp() {
		return minExp;
	}

	public void setMinExp(int minExp) {
		this.minExp = minExp;
	}

	@Column(name = "max_exp")
	public int getMaxExp() {
		return maxExp;
	}

	public void setMaxExp(int maxExp) {
		this.maxExp = maxExp;
	}

	@Column(name = "job_location")
	public int getJobLocation() {
		return jobLocation;
	}

	public void setJobLocation(int jobLocation) {
		this.jobLocation = jobLocation;
	}

	@Column(name = "functional_area")
	public int getFunctionalArea() {
		return functionalArea;
	}

	public void setFunctionalArea(int functionalArea) {
		this.functionalArea = functionalArea;
	}

	@Column(name = "compensation_type")
	public int getCompensationType() {
		return compensationType;
	}

	public void setCompensationType(int compensationType) {
		this.compensationType = compensationType;
	}

	@Column(name = "qualification")
	public int getQualification() {
		return qualification;
	}

	public void setQualification(int qualification) {
		this.qualification = qualification;
	}

	@Column(name = "industry")
	public int getIndustry() {
		return industry;
	}

	public void setIndustry(int industry) {
		this.industry = industry;
	}

	@Column(name = "company_profile")
	public String getCompanyProfile() {
		return companyProfile;
	}

	public void setCompanyProfile(String companyProfile) {
		this.companyProfile = companyProfile;
	}

	@Column(name = "employee_type")
	public int getEmploymentType() {
		return employmentType;
	}

	public void setEmploymentType(int employmentType) {
		this.employmentType = employmentType;
	}

	@Column(name = "employment_status")
	public int getEmploymentStatus() {
		return employmentStatus;
	}

	public void setEmploymentStatus(int employmentStatus) {
		this.employmentStatus = employmentStatus;
	}

	@Column(name = "company_name")
	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	@Column(name = "contact_name")
	public String getContactName() {
		return contactName;
	}

	public void setContactName(String contactName) {
		this.contactName = contactName;
	}

	@Column(name = "job_post_date")
	@Type(type = "timestamp")
	public java.util.Date getJobPostDate() {
		return jobPostDate;
	}

	public void setJobPostDate(java.util.Date jobPostDate) {
		this.jobPostDate = jobPostDate;
	}

	public boolean isStatus() {
		return status;
	}

	@Column(name = "status")
	public void setStatus(boolean status) {
		this.status = status;
	}

	@Column(name = "min_compensation")
	public int getMinCompensation() {
		return minCompensation;
	}

	public void setMinCompensation(int minCompensation) {
		this.minCompensation = minCompensation;
	}

	@Column(name = "max_compensation")
	public int getMaxCompensation() {
		return maxCompensation;
	}

	public void setMaxCompensation(int maxCompensation) {
		this.maxCompensation = maxCompensation;
	}

	@Column(name = "contact_number")
	public Long getContactNumber() {
		return contactNumber;
	}

	public void setContactNumber(Long contactNumber) {
		this.contactNumber = contactNumber;
	}

	@Column(name = "response_email")
	public String getEmailForResponse() {
		return emailForResponse;
	}

	public void setEmailForResponse(String emailForResponse) {
		this.emailForResponse = emailForResponse;
	}

	@Column(name = "job_role")
	public void setJobRole(String jobRole) {
		this.jobRole = jobRole;
	}

	public String getJobRole() {
		return jobRole;
	}

	@Override
	public String toString() {
		return "Job [jobId=" + jobId + ", clientId=" + clientId + ", jobTitle="
				+ jobTitle + ", jobDescription=" + jobDescription
				+ ", keySkills=" + keySkills + ", minExp=" + minExp
				+ ", maxExp=" + maxExp + ", jobLocation=" + jobLocation
				+ ", functionalArea=" + functionalArea + ", jobRole=" + jobRole
				+ ", compensationType=" + compensationType
				+ ", minCompensation=" + minCompensation + ", maxCompensation="
				+ maxCompensation + ", qualification=" + qualification
				+ ", industry=" + industry + ", companyProfile="
				+ companyProfile + ", employmentType=" + employmentType
				+ ", employmentStatus=" + employmentStatus + ", companyName="
				+ companyName + ", contactName=" + contactName
				+ ", contactNumber=" + contactNumber + ", emailForResponse="
				+ emailForResponse + ", jobPostDate=" + jobPostDate
				+ ", status=" + status + "]";
	}

	@Override
	public int compareTo(Job o) {
		if(this.jobId > o.jobId){
			return 1;
		}else if(this.jobId<o.jobId){
			return -1;
		}else{
			return 0;
		}
		
	}

	
	
}